package cn.homework.day07;

import java.util.Comparator;
import java.util.TreeSet;

public class Test02 {
    public static void main(String[] args) {
        String s = "90 -7 0 -32 18 2 0 2 -2 45 4";
        String[] s1 = s.split(" ");
        Integer[] i1 = new Integer[s1.length];
        for (int i = 0; i < i1.length; i++) {
            i1[i] = Integer.valueOf(s1[i]);
        }
        TreeSet<Integer> set = new TreeSet<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                if (o1 > o2) {
                    return -1;
                } else {
                    return 1;
                }
            }
        });
        for (Integer integer : i1) {
            set.add(integer);
        }
        System.out.println(set);

    }
}
